var arr=[2,34,56,78,889,45,25];
arr.so=function(){
for(var j=0;j<this.length;j++){
    var item=this[j];
    var idx=0;
    for(var i=j+1;i<this.length;i++){
        if(this[i]<item){
            item=this[i];
            idx=i;
        }
    }
    if(this[j]!=item){
        var a=this[j];
        this[j]=this[idx];
        this[idx]=a;
    }
    console.log(arr); 
}
}
arr.so();